﻿<%@ Page Title="" Language="C#" MasterPageFile="~/GUI/Admin/QuanLy.master" AutoEventWireup="true" CodeBehind="QL-Video.aspx.cs" Inherits="ProjectWebNhac.GUI.Admin.QL_Video" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script src="js/jquery.min.js" type="text/javascript"></script>
 
 
<script type="text/javascript" charset="utf-8">
    $(document).ready(function () {

        $("#<%=gvDSVideo.ClientID %>").prepend($("<thead></thead>").append($(this).find("tr:first"))).dataTable(
        { "sPaginationType": "full_numbers" });

        var txtTenVideo = $('#<%=txtTenVideo.ClientID %>').val();
        var txtTenVideoEdit = $('#<%=txtTenVideoEdit.ClientID %>');
        var txtCaSi = $('#<%=txtCaSi.ClientID %>');
        var txtCasiEdit = $('#<%=txtCasiEdit.ClientID %>');
        var txtTimespan = $('#<%=txtTimespan.ClientID %>');
        var txtTimespanEdit = $('#<%=txtTimespanEdit.ClientID %>');

        $('#btnEdit').click(function () {

            txtTenVideoEdit.val(txtTenVideo);
            txtCasiEdit.val(txtCaSi.val());
            txtTimespanEdit.val(txtTimespan.val());

        });
    }); 
</script>

<div class="page-header">
            <div class="pull-left">
              <h2>Quản Lý Video</h2>
            </div>
            <div class="pull-right">
              <ul class="stats">
                <li class="color-second">
                  <span class="fs1" aria-hidden="true" data-icon=""></span>
                  <div class="details" id="date-time"><span class="big">June 20th 2013</span><span>Thu 09:11:00 am</span></div>
                </li>
              </ul>
            </div>
            <div class="clearfix"></div>
          </div>

          <div class="row-fluid">
                <asp:Panel ID="pnDetail" runat="server">
                <div class="span8">
              <div class="widget no-margin">
                <div class="widget-header">
                  <div class="title">
                    <span class="fs1" aria-hidden="true" data-icon=""></span> Thông Tin Video
                  </div>
                </div>
                <div class="widget-body">
                  <div class="row-fluid">
                  
                    <div class="span4">
                      <div class="thumbnail">
                          <asp:Image ID="imgAvatarClip" runat="server" Width="180"
                              ImageUrl="images/male-avatar-icon-614x460.png" />
                      </div>
                    </div>

                    <div class="span6">
                      <form class="form-horizontal no-margin">
                       <div class="row-fluid">
                          <div class="span12">
                         </div>
                        </div>

                        <div class="row-fluid">
                          <label class="span5">
                            Tên Video
                          </label>
                          <div class="span4">
                          <asp:TextBox ID="txtTenVideo" Enabled="false" runat="server"></asp:TextBox>
                          </div>
                        </div>

                        <div class="row-fluid">
                          <label class="span5">
                           Ca Sĩ
                          </label>
                          <div class="span4">
                          <asp:TextBox ID="txtCaSi" Enabled="false" runat="server"></asp:TextBox>
                          </div>
                          
                        </div>

                        <div class="row-fluid">
                          <label class="span5">
                          Thời Gian
                          </label>
                          <div class="span4">
                          <asp:TextBox ID="txtTimespan" Enabled="false" runat="server"></asp:TextBox>
                          </div>
                          
                        </div>

                        <div class="row-fluid">
                          
                          <label class="span5">
                            Thể Loại Nhạc
                          </label>
                          <div class="span4">
                              <asp:DropDownList Enabled="false" ID="drTheLoaiNhac" runat="server">
                              </asp:DropDownList>
                          </div>
                        </div>

                        <div class="row-fluid">
                        <label class="span5">
                          Lượt Xem
                          </label>
                          <div class="span4">
                          <asp:TextBox ID="txtLuotXem" Enabled="false" runat="server"></asp:TextBox>
                          </div>
                        </div>


                        <div class="row-fluid">
                         <label class="span5">
                           Chọn file Video
                          </label>
                          <div class="span6">
                              <asp:FileUpload ID="flVideo" Enabled="false" runat="server" />
                          </div>
                        </div>
                        <div class="row-fluid">
                         <label class="span5">
                           Chọn Avatar Cho video
                          </label>
                          <div class="span6">
                              <asp:FileUpload ID="flAvatar" Enabled="false" runat="server" />
                          </div>
                        </div>
                        
                        <div class="form-actions ">
                         <div class="span2">
                         <asp:LinkButton ID="lnkThem" 
                                  CssClass="btn btn-primary input-top-margin" runat="server" 
                                  Text="Thêm"  ></asp:LinkButton>
                         </div>

                         <div id="divEdit" class="span2" runat="Server" visible=false>
                            <a id="btnEdit" href="#formEdit" role="button" class="btn btn-primary input-top-margin" data-toggle="modal" data-original-title="">Sửa</a>
                         </div>
                         <div class="span2">
                         <asp:LinkButton ID="lnkHuy" Visible=false CssClass="btn btn-danger input-top-margin" 
                                    runat="server"  >Hủy</asp:LinkButton>
                         </div>
                        
                        </div> 

                        <div>
                    </div>


                      </form>
                    </div>
                  </div>
                  
            <div id="formEdit" class="modal hide fade" tabindex="-4" role="dialog" aria-labelledby="myModalLabel4" aria-hidden="true">
                  <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                  ×
                                </button>
                                <h4 id="myModalLabel4">
                                  Sửa thông tin Video
                                </h4>
                              </div>
                  <div class="modal-body">
                                
                  <div class="row-fluid">
                    <div class="span12">
                      
                       <div class="row-fluid">
                          <div class="span12">
                         </div>
                        </div>

                         <div class="row-fluid">
                          <label class="span2">
                            Tên Video
                          </label>
                          <div class="span4">
                          <asp:TextBox ID="txtTenVideoEdit" runat="server" Text=""></asp:TextBox>
                          </div>
                          </div>

                         <div class="row-fluid">
                          <label class="span2">
                           Ca Sĩ
                          </label>
                          <div class="span4">
                          <asp:TextBox ID="txtCasiEdit" runat="server"></asp:TextBox>
                          </div>
                          </div>
                          <div class="row-fluid">
                          <label class="span2">
                          Thời Gian
                          </label>
                          <div class="span4">
                          <asp:TextBox ID="txtTimespanEdit" runat="server"></asp:TextBox>
                          </div>
                          </div>
                         <div class="row-fluid">
                          <label class="span2">
                            Thể Loại Nhạc
                          </label>
                          <div class="span8">
                              <asp:DropDownList ID="drTheLoaiNhacEdit" runat="server">
                              </asp:DropDownList>
                          </div>
                        </div>
                      <div>
                    </div>

                    
                    </div>
                  </div>
                 </div>
                 <div class="modal-footer">
                    <button class="btn" data-dismiss="modal" aria-hidden="true"> Close </button>
                    
                     <asp:Button class="btn btn-primary" ID="btnSaveEdit" runat="server" 
                         Text="Lưu thay đổi" onclick="btnSaveEdit_Click"  />
                 </div>
                </div>
                </div>
              </div>
            </div>
                </asp:Panel>

         </div>



         
<div class="row-fluid">
            <div class="span12">
              <div class="widget no-margin">
                <div class="widget-header">
                  <div class="title">
                    <span class="fs1" aria-hidden="true" data-icon=""></span> Danh Sách Bài Hát
                  </div>
                </div>
                <div class="widget-body">
                  <div id="dt_example" class="example_alt_pagination">

                    <div id="data-table_wrapper" class="dataTables_wrapper" role="grid">
                    
                        <asp:GridView ID="gvDSVideo" runat="server" 
                            CssClass="table table-condensed table-striped table-hover table-bordered pull-left dataTable" 
                            AutoGenerateColumns="False" onrowcommand="gvDSVideo_RowCommand" 
                            onrowdatabound="gvDSVideo_RowDataBound" >
                            <Columns>
                              
                                <asp:TemplateField HeaderText="Mã Video">
                                 <ItemTemplate>
                                    <asp:LinkButton ID="lbDetail" runat="server" 
                                        CommandArgument='<%#Eval("MaVideo")%>' CommandName="ChiTiet" Text='<%#Eval("MaVideo")%>'> </asp:LinkButton>
                                </ItemTemplate>
                                </asp:TemplateField>
                              
                                <asp:TemplateField HeaderText="Tên Video">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbTenVideo" runat="server" 
                                        CommandArgument='<%#Eval("MaVideo")%>' CommandName="ChiTiet"> <%#Eval("TenVideo")%></asp:LinkButton>
                                </ItemTemplate>
                                    <HeaderStyle CssClass="hidden-phone" HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Hình Ảnh">
                                <ItemTemplate>
                                 <img  src="../../HinhAnh/Video/<%#Eval("AvatarClip")%>">
                                </ItemTemplate>
                                </asp:TemplateField>
                              
                                <asp:TemplateField HeaderText="Ca Sĩ">
                                <ItemTemplate>
                                    <asp:Label ID="lbCaSi" runat="server" Text="Đang Cập Nhật"></asp:Label>
                                </ItemTemplate>
                                </asp:TemplateField>
                              
                                <asp:BoundField DataField="LuotXem" HeaderText="Lượt Xem" >
                                
                                </asp:BoundField>
                                
                                <asp:TemplateField HeaderText="Trạng Thái">
                                <ItemTemplate>
                                    <asp:Label ID="lbTrangThai" runat="server" Text='<%#Eval("TrangThai")%>'></asp:Label>
                                </ItemTemplate>
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="Xử Lý">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkXoa" CommandArgument='<%#Eval("MaVideo")%>' OnClientClick="javascript:return confirm('Bạn có chắc xóa Video này?');" CommandName="Xóa" CssClass="btn btn-inverse" runat="server" Text="Xóa"></asp:LinkButton>
                                </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                        </div>
                    <div class="clearfix"></div>
                  </div>
                </div>
              </div>
            </div>
          </div>

</asp:Content>
